UNPKG

@thunderstorefront/api-mock

Version:

Create Nuxt extendable layer with this GitHub template.

7 lines (5 loc) 212 B
import { products } from '../../data/products'; export default defineEventHandler(async (event) => { const id = getRouterParam(event, 'id'); return products.find((product) => product.id === id) ?? null; });